package com.mark.web.data.entity.from;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

/**
 * @Description:  新增收货时的验证表单
 * @Author: Kingsley
 * @CreateDate: 2018/10/23 23:07
 * @Version: 2.0
 * @Copyright : 豆浆油条个人非正式工作室
 */
@Data
@ApiModel(value = "收货地址新增表单")
public class ShippingAddFrom {
    private static final String PHONE_REGEXP = "^(((13[0-9])|(15([0-3]|[5-9]))|(18[0,5-9]))\\d{8})|(0\\d{2}-\\d{8})|(0\\d{3}-\\d{7})$";

    @ApiModelProperty(value = "收件人名名称",required = true)
    @NotBlank(message = "收件人名称必填")
    private String receiverName;

    @ApiModelProperty(value = "收件人联系电话", required = true)
    @NotBlank(message = "收件人联系电话必填")
    @Pattern(regexp = PHONE_REGEXP,message = "手机号格式不正确（13位有效数字）")
    private String receiverPhone;

    @ApiModelProperty(value = "省份",required = true)
    @NotBlank(message = "省份不能为空")
    private String receiverProvince;

    @ApiModelProperty(value = "城市",required = true)
    @NotBlank(message = "城市不能为空")
    private String receiverCity;

    @ApiModelProperty(value = "详细地址（具体到门牌号）",required = true)
    @NotBlank(message = "详细地址不能为空")
    private String receiverAddress;

    @ApiModelProperty(value = "邮政编码",required = true)
    @NotBlank(message = "邮政编码不能为空")
    private String receiverZip;

}
